<template>
	<view class="cpList" :class="[currPage == 'cpList' ? '' : 'myCpRep']">
		<view class="listItem" 
			v-for="(item,index) in cpList" 
			:key="index"
			@tap="goDet(item)"
		>
			<view class="listImg">
				<!-- <image class="defImg" src="../../../static/images/index/defCp.png"></image> -->
				<image class="defImg" :src="item.scaleImg" mode="aspectFill"></image>
			</view>
			<view class="listCon">
				<template v-if="cpType == 1">
					<!-- 综治测评 -->
					<view class="cpTit">{{item.city}}{{item.county}}测评</view>
					<view class="scaleTit">{{item.scaleTitle}}</view>
					<view class="totalQue">发布日期:{{item.pubTime}}</view>
					<view class="cpNum">{{item.useNum}}人已测</view>
				</template>
				<template v-else-if="cpType == 2">
					<!-- 干预测评 -->
					<view class="cpTit">{{item.scaleTitle}}</view>
					<view class="scaleTit">{{item.cpTitle}}</view>
					<view class="totalQue">发布日期:{{item.pubTime}}</view>
					<view class="totalQue spec">测评日期:{{item.cpTime}}</view>
				</template>
				<template v-if="currPage == 'cpList'">
					<view class="viewBtn listPage">点击查看</view>
				</template>
				<template v-else-if="currPage == 'myCpRep'">
					<view class="viewBtn listPage" v-if="item.logId > 0 && cpType == 1" @tap.stop="goViewCpRep(item.logId)">查看报告</view>
					<template v-if="cpType == 2">
						<view class="viewBtn listPage" v-if="item.comStatus == 1" @tap.stop="goTest(item)">去测评</view>
						<view class="viewBtn comp" v-if="item.comStatus == 2">已完成</view>
					</template>
				</template>
				<template v-else-if="currPage == 'myGy'">
					<view class="viewBtn overDate" v-if="item.gyStatus == 1">待干预</view>
					<view class="viewBtn ing" v-if="item.gyStatus == 2">干预中</view>
					<view class="viewBtn comp" v-if="item.gyStatus == 3">已完成</view>
				</template>
			</view>
		</view>
	</view>
</template>

<script>
	export default {
		props: {
			cpList: Array,
			currPage: { //cpList myCpRep(我的测评报告) myGy(我的干预)
				type: String,
				default: 'cpList'
			},
			cpType:{//myCpRep我的测评下 1综治测评 2.干预测评
				type:Number,
				default:1
			}
		},
		methods:{
			goDet(item){
				this.$emit('goDet',item);
			},
			//查看测报告
			goViewCpRep(logId){
				this.$emit('goViewCpRep',logId);
			},
			goTest(item){
				this.$emit('goTest',item);
			}
		}
	}
</script>

<style lang="scss" scoped>
	@import '../../../static/scss/cpList.scss';
</style>